<%@ page language="java" pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/inc/taglibs.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
    <title>网站信息</title>  
    <link rel="stylesheet" href="${path }/admin/css/pintuer.css"/>
    <link rel="stylesheet" href="${path }/admin/css/admin.css"/>
    <script src="${path }/public/js/jquery-1.8.2.min.js"></script>
    <script src="${path }/admin/js/pintuer.js"></script>  
    <script type="text/javascript">
    function updateflag(id,flag){
		var param = {};
		param.id=id;
		param.flag=flag;
		$.ajax({
			type : "post",
			url :'${path}/admin/user/updateflag.do',
			data : param,
			dataType : 'json',
			success : function(datas) {
				if(datas==1){
					window.location.reload();
				}else{
					alert("删除失败");
				}
			}
		});
}
    
    function updategroup(id,groupid){
		var param = {};
		param.id=id;
		param.groupid=groupid;
		$.ajax({
			type : "post",
			url :'${path}/admin/user/updategroup.do',
			data : param,
			dataType : 'json',
			success : function(datas) {
				if(datas==1){
					window.location.reload();
				}else{
					alert("删除失败");
				}
			}
		});
}
    function updatepwd(id){
    	if(confirm("您确定要重置密码吗?")){
    		var param = {};
    		param.id=id;
    		$.ajax({
    			type : "post",
    			url :'${path}/admin/user/updatepwd.do',
    			data : param,
    			dataType : 'json',
    			success : function(datas) {
    				if(datas==1){
    					alert("重置密码成功,新密码为123456!");
    					window.location.reload();
    				}else{
    					alert("删除失败");
    				}
    			}
    		});
    	}
    }
    

    function del(id){
    	if(confirm("您确定要删除吗?")){
    		var param = {};
    		param.id=id;
    		$.ajax({
    			type : "post",
    			url :'${path}/admin/user/del.do',
    			data : param,
    			dataType : 'json',
    			success : function(datas) {
    				if(datas==1){
    					alert("删除成功");
    					window.location.href='${path}/admin/user/index.do';
    				}else{
    					alert("删除失败");
    				}
    			}
    		});
    	}
    }
    function updatestopip(id){
    	if(confirm("您确定要禁用此用户ip吗?")){
    		var param = {};
    		param.id=id;
    		$.ajax({
    			type : "post",
    			url :'${path}/admin/stopip/updatestopid.do',
    			data : param,
    			dataType : 'json',
    			success : function(datas) {
    				alert("操作成功");
    				window.location.reload();
    			}
    		});
    	}
    }

    function delallinfo(id){
    	if(confirm("您确定要删除该用户下所有数据吗?")){
    		var param = {};
    		param.id=id;
    		$.ajax({
    			type : "post",
    			url :'${path}/admin/user/deluserallinfo.do',
    			data : param,
    			dataType : 'json',
    			success : function(datas) {
    				if(datas==1){
    					window.location.reload();
    				}else{
    					alert("删除失败");
    				}
    			}
    		});
    	}
    }


    </script> 
</head>
<body>
<div class="panel admin-panel">
  <div class="panel-head"><strong><span class="icon-pencil-square-o"></span> 活动详情</strong></div>
  <div class="body-content" style="padding-left: 30px;">
      <div class="form-group">
        <div class="field">
          <label>活动名称：${activity.name}</label>
        </div>
      </div>
      <div class="form-group">
        <div class="field">
          <label>报名时间：${activity.enStartTimeStr}~${activity.enEndTimeStr}</label>
        </div>
      </div>
      <div class="form-group">
        <div class="field">
          <label>活动时间：${activity.startTimeStr}~${activity.endTimeStr}</label>
        </div>
      </div>
      <div class="form-group">
        <div class="field">
          <label>活动规则：${activity.ruleType}</label>
        </div>
      </div>
      <div class="form-group">
        <div class="field">
          <label>活动类型：${activity.type}</label>
        </div>
      </div>
      <div class="form-group">
        <div class="field">
          <label>触发方式：${activity.triggerType}</label>
        </div>
      </div>
      <div class="form-group">
        <div class="field">
          <label>人数上限：${activity.maxCount}</label>
        </div>
      </div>
      



      <div class="form-group">
        <div class="field" style="" >
          <label>奖项设置： </label>
        </div>
		        <div class="field" style="margin-left: 100px;margin-top: -20px" >
		          <table style="width: 500px">
		          <tr><td style="width: 14%">奖品名称</td><td style="width: 50%">奖品内容</td><td  style="width: 10%">显示排序</td></tr>
		          <c:forEach items="${activity.prizeList}" var="prize" varStatus="index">
		          	<tr><td>${prize.name}</td><td>${prize.prize}</td><td>${prize.sort}</td></tr>
		          </c:forEach>
		          </table>
		        </div>
      </div>
      
      
      <div class="form-group">
        <div class="field"  >
          <label>流程设置：</label>
        </div>
		        <div class="field"  style="margin-left: 100px;margin-top: -20px" >
		          <table style="width: 500px">
		          <tr><td style="width: 14%">流程名称</td><td style="width: 50%">流程时间</td><td  style="width: 10%">显示排序</td></tr>
		          <c:forEach items="${activity.arrangeList}" var="arrange" varStatus="index">
		          	<tr><td>${arrange.name}</td><td>${arrange.startTimeStr}~${arrange.endTimeStr}</td><td>${arrange.sort}</td></tr>
		          </c:forEach>
		          </table>
		        </div>
      </div>
      
      
      
      <div class="form-group">
        <div class="field">
          <label>活动图片：</label>
        </div>
           <div class="field"  style="margin-left: 100px;margin-top: -20px" >
                <c:forEach items="${activity.actFileList}" var="file" varStatus="">
                <img src="${file.filePath}" style=" width: auto; height: auto; max-width: 40%; max-height: 40%;">
                </c:forEach>
		   </div>
      </div>
      
      <div class="form-group">
        <div class="field">
          <label>广告图片：</label>
        </div>
           <div class="field"  style="margin-left: 100px;margin-top: -20px" >
                <c:forEach items="${activity.adFileList}" var="file" varStatus="">
                <img src="${file.filePath}" style=" width: auto; height: auto; max-width: 40%; max-height: 40%;">
                </c:forEach>
		   </div>
      </div>
      
      <div class="form-group">
        <div class="field">
          <label>活动描述：</label>
        </div>
                <div class="field"  style="margin-left: 100px;margin-top: -20px" >
                   <textarea rows="5" cols="111">${activity.describer}</textarea>                     
		        </div>
      </div>
      
      <div class="form-group">
        <div class="field">
<%-- 	          <a class="button border-main" href="javascript:void(0)" onclick="updateflag(${activity.id},1)"><span class="icon-edit"></span> 启用</a> --%>
<%-- 	          <a class="button border-main" href="javascript:void(0)" onclick="updateflag(${activity.id},0)"><span class="icon-lock"></span> 禁用</a> --%>
<%-- 	          <a class="button border-main" href="javascript:void(0)" onclick="updategroup(${activity.id},3)"><span class="icon-edit"></span> 取消管理员</a> --%>
<%-- 	          <a class="button border-main" href="javascript:void(0)" onclick="updategroup(${activity.id},1)"><span class="icon-edit"></span> 设置管理员</a> --%>
          
<%--           <a class="button border-main" href="javascript:void(0)" onclick="updatepwd(${activity.id})"><span class="icon-edit"></span> 重置密码</a> --%>
<%--           <a class="button border-red" href="javascript:void(0)" onclick="del(${activity.id})"><span class="icon-trash-o"></span> 删除</a>  --%>
<%--           <a class="button border-red" href="javascript:void(0)" onclick="delallinfo(${activity.id})"><span class="icon-trash-o"></span> 删除所有数据</a>  --%>
<%--           <a class="button border-red" href="javascript:void(0)" onclick="updatestopip(${activity.id})"><span class="icon-trash-o"></span> 禁用ip</a> --%>
          <button class="button border-red icon-tags" type="button" onclick="window.history.go(-1);"> 返回</button>
        </div>
      </div>
  </div>
</div>
</body></html>